home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Periodicals / CSMP / C.S.M.P. Digest, Issue 3.026 < prev    next >
Internet Message Format  |  1994-06-09  |  77KB

  1. From: pottier@clipper.ens.fr (Francois Pottier)
  2. Subject: csmp-digest-v3-026
  3. Date: Fri, 13 May 94 0:30:43 MET DST
  4.  
  5. C.S.M.P. Digest             Thu, 12 May 94       Volume 3 : Issue 26
  6.  
  7. Today's Topics:
  8.  
  9.         Can I send Apple Event from Script Editor?
  10.         Disk Cache performance evaluation test software
  11.         Extension Shell 1.3 - Help for INIT writers
  12.         FFT benchmark using CodeWarrior
  13.         How do I find the window colour ???
  14.         Private inheritance faulty in SC++ 7.0
  15.         Source Control Questions
  16.         Using xlc to generate PowerMacintosh code
  17.  
  18.  
  19.  
  20. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  21. (pottier@clipper.ens.fr).
  22.  
  23. The digest is a collection of article threads from the internet newsgroup
  24. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  25. regularly and want an archive of the discussions.  If you don't know what a
  26. newsgroup is, you probably don't have access to it.  Ask your systems
  27. administrator(s) for details.  If you don't have access to news, you may
  28. still be able to post messages to the group by using a mail server like
  29. anon.penet.fi (mail help@anon.penet.fi for more information).
  30.  
  31. Each issue of the digest contains one or more sets of articles (called
  32. threads), with each set corresponding to a 'discussion' of a particular
  33. subject.  The articles are not edited; all articles included in this digest
  34. are in their original posted form (as received by our news server at
  35. nef.ens.fr).  Article threads are not added to the digest until the last
  36. article added to the thread is at least two weeks old (this is to ensure that
  37. the thread is dead before adding it to the digest).  Article threads that
  38. consist of only one message are generally not included in the digest.
  39.  
  40. The digest is officially distributed by two means, by email and ftp.
  41.  
  42. If you want to receive the digest by mail, send email to listserv@ens.fr
  43. with no subject and one of the following commands as body:
  44.     help                        Sends you a summary of commands
  45.     subscribe csmp-digest Your Name    Adds you to the mailing list
  46.     signoff csmp-digest            Removes you from the list
  47. Once you have subscribed, you will automatically receive each new
  48. issue as it is created.
  49.  
  50. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  51. Questions related to the ftp site should be directed to
  52. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  53. digest are available there.
  54.  
  55. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  56.  
  57.  
  58. -------------------------------------------------------
  59.  
  60. >From RTY868@email.nml.mot.com (Masaaki Iwasa)
  61. Subject: Can I send Apple Event from Script Editor?
  62. Date: Wed, 27 Apr 1994 09:03:56 GMT
  63. Organization: Nippon Motorola Limited,  Tokyo  Japan
  64.  
  65. Dose someone know if an Apple Event can be sent from within Script Editor
  66. to an Apple Event aware but not Apple Scriptable program?
  67.  
  68. I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  69. know I can send them from HyperCard.
  70.  
  71. No way??
  72.  
  73. -- 
  74. Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  75. Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  76.  
  77. +++++++++++++++++++++++++++
  78.  
  79. >From jwbaxter@olympus.net (John W. Baxter)
  80. Date: Thu, 28 Apr 1994 07:28:26 -0700
  81. Organization: Internet for the Olympic Peninsula
  82.  
  83. In article <RTY868-270494180057@180.3.150.33>, RTY868@email.nml.mot.com
  84. (Masaaki Iwasa) wrote:
  85.  
  86. > Dose someone know if an Apple Event can be sent from within Script Editor
  87. > to an Apple Event aware but not Apple Scriptable program?
  88. > I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  89. > know I can send them from HyperCard.
  90.  
  91. You can send arbitrary Apple events to any application which has the proper
  92. bit set to say it accepts high level events.
  93.  
  94. The syntax in AppleScript for doing so is rather ugly...if you have Think
  95. Project Manager 6 (or, likely 7, but I'm not sure of that), try turning
  96. recording on in the Script Editor, then going into Think Project Manager
  97. and changing the option regarding the generation of MacsBug symbols.  That
  98. should record as a generic event, and give you an idea of the syntax.
  99.  
  100. UserLand Frontier provides a somewhat clearer syntax for sending such
  101. events...in either scripting system, you can of course write subroutines
  102. which hide the gory mess from the rest of your code.
  103.  
  104. -- 
  105. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  106.    jwbaxter@pt.olympus.net
  107.  
  108. +++++++++++++++++++++++++++
  109.  
  110. >From isis@netcom.com (Mike Cohen)
  111. Date: Thu, 28 Apr 1994 18:29:22 GMT
  112. Organization: ISIS International
  113.  
  114. RTY868@email.nml.mot.com (Masaaki Iwasa) writes:
  115.  
  116. >Dose someone know if an Apple Event can be sent from within Script Editor
  117. >to an Apple Event aware but not Apple Scriptable program?
  118.  
  119. >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  120. >know I can send them from HyperCard.
  121.  
  122. >No way??
  123.  
  124. >-- 
  125. >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  126. >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  127.  
  128. you can send any event using something like:
  129.  tell application "foo" to <<event XXXXYYYY>> directobject given
  130.     <<class ZZZZ>> someotherparam
  131.  
  132. Note that the << and >> should really be opt-backslash & shift-opt-backslash.
  133. -- 
  134. Mike Cohen - isis@netcom.com
  135. NewtonMail, eWorld: MikeC / ALink: D6734 / AOL: MikeC20
  136.  
  137. +++++++++++++++++++++++++++
  138.  
  139. >From paul@ctalk.exnet.com (Paul G Smith)
  140. Date: Thu, 28 Apr 94 21:45:33 GMT
  141. Organization: commstalk, & Full Moon Software Inc
  142.  
  143.  
  144. In article <isisCozFCy.JAM@netcom.com> (comp.sys.mac.programmer), isis@netcom.com (Mike Cohen) writes:
  145. > >Dose someone know if an Apple Event can be sent from within Script Editor
  146. > >to an Apple Event aware but not Apple Scriptable program?
  147. > >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  148. > >know I can send them from HyperCard.
  149. > >No way??
  150. > >-- 
  151. > >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  152. > >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  153. > you can send any event using something like:
  154. >  tell application "foo" to <<event XXXXYYYY>> directobject given
  155. >     <<class ZZZZ>> someotherparam
  156.  
  157. There is another way to do this... not guaranteed to be the best solution
  158. for your needs, but it will make for easier scripting:
  159.  
  160. Why not create an 'aete' resource for Microsoft Project? It's not
  161. a trivial task, admittedly, but it's not all that hard (especially
  162. if you take one from another app to use as a starting point). There
  163. is a template for ResEdit for editing aete resources. When you have
  164. done this, and given a human-readable terminology to the apple events,
  165. you'll find it _very_ easy to script them from the Script Editor.
  166.  
  167.  
  168. best regards, Paul
  169.  
  170. - --------------------------------------------------------------
  171. Paul G Smith, Commstalk HQ          ||  UK ph: +44 727 844232
  172. P O Box 116, ST ALBANS              ||    fax: +44 727 856139
  173. Hertfordshire. AL1 2RL. UK          ||  US ph: 408 253 7199
  174. & Full Moon Software, Inc           ||    fax: 408 252 2378
  175. P O Box 700237, SAN JOSE, CA 95170  ||  AppleLink: COMMSTALK.HQ 
  176.  
  177. ---------------------------
  178.  
  179. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  180. Subject: Disk Cache performance evaluation test software
  181. Date: 9 Apr 1994 17:38:54 GMT
  182. Organization: Stanford University
  183.  
  184. The test program writes 512K to disk, using various block sizes, from 1024
  185. FSWrite calls of 512 bytes each to 32 FSWrite of 16K each.
  186.  
  187. Each test is done three ways, firstly with simple FSWrite, then with FSWrite
  188. alternating with PBFlushFile, and then with FSWriteNoCache.
  189.  
  190. The first is what you might naively write in a program which is trying to run
  191. cooperatively in the background while transferring a file to disk. It results
  192. in all the writes going to the cache, and then the Mac freezes solid for ten
  193. seconds when the file is closed.
  194.  
  195. The second is an attempt to fix this by flushing the file to disk after every
  196. write. It achieves the goal of spreading the delay over all the writes,
  197. instead of having a big freeze at the end, but it still takes over 10 seconds.
  198.  
  199. The third method was pointed out to me by Jim Matthews (author of Fetch). It
  200. uses the little known (but supported -- see IM:Files, page 89) non-caching
  201. option of PBWrite.
  202. Similarly, this achieves the goal of spreading the delay over all the writes,
  203. but it also makes it go up to 25 times faster.
  204.  
  205. Results:
  206.  
  207. Tests were performed with a Macintosh Quadra 700, System 7.0.1/Tuneup 1.1.1,
  208. 768KB disk cache, 32 bit addressing, no virtual memory, 20MB RAM:
  209.  
  210. Testing Writing 512K in various block sizes
  211. Testing 0.5K blocks
  212. Standard writes:    Write:  39 (! 0s)  Close: 691 (!11s)  Total: 730 (!12s)
  213. Write and flush:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  214. No-cache writes:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  215. Testing   1K blocks
  216. Standard writes:    Write:  26 (! 0s)  Close: 691 (!11s)  Total: 717 (!11s)
  217. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  218. No-cache writes:    Write: 346 (! 5s)  Close:   0 (! 0s)  Total: 346 (! 5s)
  219. Testing   2K blocks
  220. Standard writes:    Write:  23 (! 0s)  Close: 692 (!11s)  Total: 715 (!11s)
  221. Write and flush:    Write: 691 (!11s)  Close:   0 (! 0s)  Total: 691 (!11s)
  222. No-cache writes:    Write:  85 (! 1s)  Close:   0 (! 0s)  Total:  85 (! 1s)
  223. Testing   4K blocks
  224. Standard writes:    Write:  21 (! 0s)  Close: 692 (!11s)  Total: 713 (!11s)
  225. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  226. No-cache writes:    Write:  51 (! 0s)  Close:   0 (! 0s)  Total:  51 (! 0s)
  227. Testing   8K blocks
  228. Standard writes:    Write:  21 (! 0s)  Close: 691 (!11s)  Total: 712 (!11s)
  229. Write and flush:    Write: 690 (!11s)  Close:   1 (! 0s)  Total: 691 (!11s)
  230. No-cache writes:    Write:  39 (! 0s)  Close:   0 (! 0s)  Total:  39 (! 0s)
  231. Testing  16K blocks
  232. Standard writes:    Write:  17 (! 0s)  Close: 692 (!11s)  Total: 709 (!11s)
  233. Write and flush:    Write: 694 (!11s)  Close:   0 (! 0s)  Total: 694 (!11s)
  234. No-cache writes:    Write:  26 (! 0s)  Close:   1 (! 0s)  Total:  27 (! 0s)
  235.  
  236. Notice that:
  237.  
  238. 1. With the simple writes, every block size, even 16K, incurs a Mac-crippling
  239. ten second freeze when the file is closed.
  240.  
  241. 2. Using write and flush takes the same time as simple writes, but spread
  242. over all the Write calls instead of in a single big freeze at the end.
  243.  
  244. 3. In BOTH of the above cases, it takes at best 691 ticks to write 512K,
  245. making a data rate of 44.5K/sec.
  246.  
  247. 4. Using No-cache writes incurs no freeze for the close call, and if you are
  248. writing 4K blocks it achieves 602K/sec, more than ten times faster than the
  249. simple writes. If you are prepared to go to 16K blocks, it exceeds a
  250. megabyte per second -- more than 25 times faster than simple writes with
  251. the same block size.
  252.  
  253. If anyone wishes to run the test program and give me results for other
  254. configurations, why not post those results here.
  255.  
  256. Stuart Cheshire <cheshire@cs.stanford.edu>
  257.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  258.  * Stanford Distributed Systems Group Research Assistant
  259.  * Escondido Village Resident Computer Coordinator
  260.  * Macintosh Programmer
  261. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  262. Subject: Disk Cache performance evaluation test software
  263. Date: 9 Apr 1994 18:48:06 GMT
  264. Organization: Stanford University
  265.  
  266. // Copyright (C) 23rd November 1993
  267. // Stuart Cheshire <cheshire@cs.stanford.edu>
  268.  
  269. #include <stdio.h>
  270. #include <stdlib.h>
  271.  
  272. #define FILE_SIZE      0x80000
  273. #define MAX_BLOCK_SIZE 0x4000
  274. static char *buffer;
  275. static SysEnvRec sysenvirons;
  276. static const unsigned char filename[] = "\pFlusherTestFile";
  277. static IOParam fileflusher;
  278.  
  279. static OSErr FSWriteNoCache(short refnum, long *count_p, const Ptr buffer_p)
  280.     {
  281.     OSErr retcode;
  282.     ParamBlockRec pb;
  283.     pb.ioParam.ioCompletion = 0;
  284.     pb.ioParam.ioRefNum     = refnum;
  285.     pb.ioParam.ioBuffer     = buffer_p;
  286.     pb.ioParam.ioReqCount   = *count_p;
  287.     pb.ioParam.ioPosMode    = fsAtMark | 0x20; /* don't cache */
  288.     pb.ioParam.ioPosOffset  = 0;
  289.     retcode = PBWrite(&pb, false);
  290.     *count_p = pb.ioParam.ioActCount;
  291.     return(retcode);
  292.     }
  293.  
  294. static void filetest(unsigned long block_size, short testcase)
  295.     {
  296.     long inOutCount, t1, t2, t3;
  297.     short fRefNum, i, num_blocks = FILE_SIZE / block_size;
  298.     FSDelete(filename, sysenvirons.sysVRefNum);
  299.     if (Create(filename, sysenvirons.sysVRefNum, '????', '????'))
  300.         { printf("Create failed\n"); exit(1); }
  301.     if (FSOpen(filename, sysenvirons.sysVRefNum, &fRefNum))
  302.         { printf("FSOpen failed\n"); exit(1); }
  303.     fileflusher.ioCompletion = NULL;
  304.     fileflusher.ioResult     = noErr;
  305.     fileflusher.ioRefNum     = fRefNum;
  306.     t1 = TickCount();
  307.     for (i=0; i<num_blocks; i++)
  308.         {
  309.         inOutCount = block_size;
  310.         switch (testcase)
  311.             {
  312.             case 0: FSWrite(fRefNum, &inOutCount, buffer);
  313.                     break;
  314.             case 1: FSWrite(fRefNum, &inOutCount, buffer);
  315.                     if (fileflusher.ioResult == noErr)
  316.                         PBFlushFile((ParmBlkPtr)&fileflusher, TRUE);
  317.                     break;
  318.             case 2: FSWriteNoCache(fRefNum, &inOutCount, buffer);
  319.                     break;
  320.             }
  321.         }
  322.     t2 = TickCount();
  323.     if (FSClose(fRefNum)) { printf("FSClose failed\n"); exit(1); }
  324.     t3 = TickCount();
  325.     FSDelete(filename, sysenvirons.sysVRefNum);
  326.     printf("Write:%4ld (!%2lds)  ", t2-t1, (t2-t1)/60);
  327.     printf("Close:%4ld (!%2lds)  ", t3-t2, (t3-t2)/60);
  328.     printf("Total:%4ld (!%2lds)\n", t3-t1, (t3-t1)/60);
  329.     }
  330.  
  331. static void blocktest(unsigned long block_size)
  332.     {
  333.     printf("Standard writes:    "); filetest(block_size, 0);
  334.     printf("Write and flush:    "); filetest(block_size, 1);
  335.     printf("No-cache writes:    "); filetest(block_size, 2);
  336.     }
  337.  
  338. void main(void)
  339.     {
  340.     buffer = NewPtr(MAX_BLOCK_SIZE);
  341.     if (!buffer) { printf("Not enough memory\n"); exit(1); }
  342.     SysEnvirons(curSysEnvVers, &sysenvirons);
  343.     printf("Testing Writing %ldK in various block sizes\n", FILE_SIZE / 1024);
  344.     printf("Testing 0.5K blocks\n"); blocktest( 0x200);
  345.     printf("Testing   1K blocks\n"); blocktest( 0x400);
  346.     printf("Testing   2K blocks\n"); blocktest( 0x800);
  347.     printf("Testing   4K blocks\n"); blocktest(0x1000);
  348.     printf("Testing   8K blocks\n"); blocktest(0x2000);
  349.     printf("Testing  16K blocks\n"); blocktest(0x4000);
  350.     }
  351.  
  352.  
  353. Stuart Cheshire <cheshire@cs.stanford.edu>
  354.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  355.  * Stanford Distributed Systems Group Research Assistant
  356.  * Escondido Village Resident Computer Coordinator
  357.  * Macintosh Programmer
  358.  
  359. +++++++++++++++++++++++++++
  360.  
  361. >From qsi@cnh.wlink.nl (Peter Kocourek)
  362. Date: Sun, 10 Apr 1994 15:45:39 +0100
  363. Organization: (none)
  364.  
  365. Stuart Cheshire wrote in a message on 09 Apr 94
  366.  
  367. [... test results deleted]
  368.  
  369.  SC> Notice that: 
  370.  SC> 1. With the simple writes, every block size, even 16K, incurs 
  371.  SC> a Mac-crippling ten second freeze when the file is closed. 
  372.  
  373. Actually, this depends on the size of the cache; the smaller the cache, the
  374. sooner you'll get decent performance with increasing block size. Once a certain
  375. threshold is passed (in terms of blocksize vs. cachesize), the performance will
  376. improve enormously. Unfortunately, even with just a 32K cache, you need a
  377. fairly large blocksize (I forget the exact figures). I have run similar tests
  378. with a port of the Unix iozone program, which benchmarks file system
  379. performance, and that's how I discovered the rather useless nature of the
  380. cache. I did not know about the no-cache bit, though...
  381.  
  382.  
  383. YHS:QSI!
  384.  
  385.  
  386. +++++++++++++++++++++++++++
  387.  
  388. >From whbenson@lbl.gov (Bill Benson)
  389. Date: Tue, 12 Apr 1994 15:13:52 -0800
  390. Organization: Lawrence Berkeley Lab
  391.  
  392. Does anyone know if there would be any (significant) performance gain from
  393. disabling the cache while reading? (as opposed to writing)
  394. -Bill Benson, Lawrence Berkeley Lab, whbenson@lbl.gov
  395.  
  396. +++++++++++++++++++++++++++
  397.  
  398. >From Alan_B._Harper@bmug.org (Alan B. Harper)
  399. Date: Tue, 12 Apr 94 02:04:15 PST
  400. Organization: Berkeley Macintosh Users Group
  401.  
  402. There was an interesting note by Mike Scanlin in MacTech magazine (April 1993,
  403. p. 75)
  404. about the Apple disk cache.  I can't quote the entire article, but a relevant
  405. section is
  406.  
  407. > The formula [Apple] uses to decide if any given read or write should
  408. > be cached is:
  409. >   numCacheBlocks = user-defined cache size DIV 512;
  410. >   maxCachedReadWrite = (numCacheBlocks - 1) * 16;
  411. > So with a cache size of 256K you get
  412. >     numCacheBlocks = 512;
  413. >   maxCachedReadWrite = 8176
  414. > That means that any read/write larger than 8176 bytes will not be cached.  So
  415. in
  416. > my test app [described in the article], nothing was being cached until the
  417. cache
  418. > was 384K or larger, at which time my 8K writes were being cached (and I got
  419. > a 13x performance slow-down).
  420.  
  421. Basically, this means that if your app either does its own caching, or if it
  422. writes something it knows it won't need again, always set the no-cache bit.
  423.  
  424. +++++++++++++++++++++++++++
  425.  
  426. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  427. Date: Thu, 14 Apr 1994 16:08:37 +0800
  428. Organization: NCRPDA, Curtin University
  429.  
  430. In article <0013A0ED.fc@bmug.org>, Alan_B._Harper@bmug.org (Alan B.
  431. Harper) wrote:
  432.  
  433. >Basically, this means that if your app either does its own caching, or if it
  434. >writes something it knows it won't need again, always set the no-cache bit.
  435.  
  436. Not entirely.  Even if you know it will be read again, it is often better
  437. to disable the cache.  For example, I get better performance out of
  438. Anarchie downloading files and then feeding them to StuffIt Expander if
  439. the cache is inhibited during the download even though I know Expander
  440. will read the file as soon as I'm finished.
  441.  
  442. Basically, disable the cahce unless you are writing 10 byte blocks, and
  443. *DONT* write ten byte blocks!  If you write lots of small blocks, the
  444. FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  445. file could end up with close times measured in minutes.
  446.    Peter.
  447. _______________________________________________________________________
  448. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  449.  
  450. +++++++++++++++++++++++++++
  451.  
  452. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  453. Date: 16 Apr 1994 17:03:25 GMT
  454. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  455.  
  456. In article <whbenson-120494151352@twinpeaks.lbl.gov> whbenson@lbl.gov (Bill Benson) writes:
  457. >
  458. > Does anyone know if there would be any (significant) performance gain from
  459. > disabling the cache while reading? (as opposed to writing)
  460.  
  461. the simple answer is that you aren't likely to see any performance gain, and
  462. (and if do this indiscriminantly) you'll make things much worse.
  463.  
  464. when you read a chunk from the disk, if it's not in the cache, the disk
  465. _must_ be accessed.  there's no way around this, and disk accesses are
  466. slow.
  467.  
  468. of course, if the data is in the cache, then the read is quite fast.  this
  469. is the basic idea of caches - keep useful data in the cache to avoid
  470. having to access the disk.
  471.  
  472. knowing what data is going to be useful is difficult, but a few rules of
  473. thumb have proved useful:
  474.   if it was accessed recently, it is likely to be accessed again soon
  475.   if an area was accessed, the surrounding area is likely to be accessed
  476.     in the near future
  477.  
  478. thus, whenever you access the disk, cache it somewhere because you're likely
  479. to need it again. and grab a little bit more than you need, because you're
  480. likely to need that, too.
  481.  
  482. turning off the caches effectively disables this optimization.  the only
  483. time it may be useful is if you know _absolutely_ that you'll never need
  484. it again.  even then, you probably won't notice the speed benefit (since
  485. the disk access is the most significant part, and you can't avoid that).
  486.  
  487. if you load something into the cache that isn't used, it'll eventually
  488. get swapped out for useful data. it's usually not worth worrying about.
  489.  
  490.  
  491. WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  492. the disk access by deferring it until later.
  493.  
  494.  
  495. hope this clears things up,
  496.  
  497.  
  498. -gary j kacmarcik
  499. platypus@cirrus.som.cwru.edu
  500.  
  501. +++++++++++++++++++++++++++
  502.  
  503. >From Cameron Esfahani <dirty@guest.apple.com>
  504. Date: Sun, 17 Apr 1994 09:20:34 GMT
  505. Organization: Apple Computer, Inc.
  506.  
  507. In article <PLATYPUS.94Apr16130325@cirrus.som.cwru.edu> Gary Kacmarcik,
  508. platypus@cirrus.som.cwru.edu writes:
  509. > knowing what data is going to be useful is difficult, but a few rules of
  510. > thumb have proved useful:
  511. >   if it was accessed recently, it is likely to be accessed again soon
  512. >   if an area was accessed, the surrounding area is likely to be accessed
  513. >     in the near future
  514. > thus, whenever you access the disk, cache it somewhere because you're likely
  515. > to need it again. and grab a little bit more than you need, because you're
  516. > likely to need that, too.
  517. > if you load something into the cache that isn't used, it'll eventually
  518. > get swapped out for useful data. it's usually not worth worrying about.
  519.  
  520. One problem with this is that you have to get the space in the
  521. cache from someplace!  Then you have to decide what information to
  522. throw out, just so you can read in this extra information which
  523. might never be used...
  524.  
  525. > WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  526. > the disk access by deferring it until later.
  527.  
  528. I think you have this backwards; by turning off the cache how does
  529. that eliminate the disk access?  If anything, having a cache will
  530. eliminate the write out to disk by sticking it in the cache and
  531. deferring the write until later...
  532.  
  533. Cameron Esfahani
  534. dirty@apple.com
  535. I make things go faster...
  536.  
  537. +++++++++++++++++++++++++++
  538.  
  539. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  540. Date: 18 Apr 1994 22:21:20 GMT
  541. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  542.  
  543.  
  544. In article <1994Apr17.092034.5202@gallant.apple.com> Cameron Esfahani <dirty@guest.apple.com> writes:
  545. >
  546. > In article <PLATYPUS.94Apr16130325@cirrus.som.cwru.edu> Gary Kacmarcik,
  547. > platypus@cirrus.som.cwru.edu writes:
  548. > > 
  549. > > WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  550. > > the disk access by deferring it until later
  551. >
  552. > I think you have this backwards; by turning off the cache how does
  553. > that eliminate the disk access?  If anything, having a cache will
  554. > eliminate the write out to disk by sticking it in the cache and
  555. > deferring the write until later...
  556.  
  557. whoa!  what was i smoking when i wrote that...
  558.  
  559. Cameron is, of course, correct in his correction.
  560.  
  561. -gary
  562.  
  563. +++++++++++++++++++++++++++
  564.  
  565. >From lsr@taligent.com (Larry Rosenstein)
  566. Date: Wed, 20 Apr 1994 23:07:56 GMT
  567. Organization: Taligent, Inc.
  568.  
  569. In article <peter.lewis-140494160837@rocky.curtin.edu.au>,
  570. peter.lewis@info.curtin.edu.au (Peter N Lewis) wrote:
  571.  
  572. > Basically, disable the cahce unless you are writing 10 byte blocks, and
  573. > *DONT* write ten byte blocks!  If you write lots of small blocks, the
  574. > FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  575.  
  576. This is good advice for other reasons as well.  If the file lives on a
  577. server being accessed via ARA, then writing small-sized blocks will be
  578. extremely slow.  
  579.  
  580. -- 
  581. Larry Rosenstein
  582. Taligent, Inc.
  583.  
  584. lsr@taligent.com
  585.  
  586. +++++++++++++++++++++++++++
  587.  
  588. >From jumplong@aol.com (Jump Long)
  589. Date: 28 Apr 1994 12:51:06 -0400
  590. Organization: America Online, Inc. (1-800-827-6364)
  591.  
  592. In article <lsr-200494160756@kip-20.taligent.com>, lsr@taligent.com (Larry
  593. Rosenstein) writes:
  594.  
  595. >> Basically, disable the cahce unless you are writing 10 byte blocks, and
  596. >> *DONT* write ten byte blocks!  If you write lots of small blocks, the
  597. >> FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  598. >
  599. > This is good advice for other reasons as well.  If the file lives on a
  600. > server being accessed via ARA, then writing small-sized blocks will be
  601. > extremely slow.  
  602.  
  603. Here's a little more information about AppleShare...
  604.  
  605. I'm not sure about AppleShare Pro and AppleShare 4.0 (I suspect it hasn't
  606. changed), but the AppleShare 3.0.x, Macintosh File Sharing and AppleShare 2.0
  607. file servers always set the noCache bit for all file access on the server
  608. system. They do that because if there are multiple users hitting multiple files
  609. on the server, any blocks cached by one user tend to be flushed by I/O by from
  610. another user.  On the AppleShare client system, the noCache bit is ignored (the
  611. AppleShare foreign file system does not use the File Manager's cache *at*
  612. *all*).  The only thing cached by the AppleShare foreign file system is entries
  613. returned by AFPEnumerate which is used to get information in response to
  614. indexed GetFInfo and GetCatInfo calls (and the cached directory entries are
  615. only kept for a very short period of time).
  616.  
  617. Since the AppleTalk Filing Protocol (AFP) is built on top of the AppleTalk
  618. Transaction Protocol (ATP), the amount of data transferred from server to
  619. client or client to server is limited to around 4K per AFP request (the maximum
  620. size of an ATP reply). Larger requests to AFP are broken up by the protocol
  621. code. For example, If you do a PBRead asking for 8K of data from a file on an
  622. AppleShare server, AFP will ask the server for 8K and will get back around 4K. 
  623. So, it will ask for the remaining 4K to finish up the request.  So, with the
  624. AppleShare 3.0.x, Macintosh File Sharing and AppleShare 2.0 file servers, the
  625. server reads everything in 4K chunks and writes everything in 4K chunks, no
  626. matter how large the requests were on the client side.
  627.  
  628. AppleShare Pro and AppleShare 4.0 improve performance dramatically by caching
  629. data on the server.  For example, if an 8K read request is received from a
  630. client, the server reads 8K into its cache and returns 4K (because of the ATP
  631. limitation).  When the AFP client asks for the remaining 4K, the server gets it
  632. from its cache which saves a hit to the disk.
  633.  
  634. So, with file access to an AppleShare volume:
  635.  
  636. o  The noCache bit in your Reads and Writes makes no difference whatsoever.
  637.  
  638. o  Using large Read and Writes from the client will improve performance -
  639. especially with AppleShare Pro and AppleShare 4.0.
  640.  
  641. -- Jim Luther
  642.  
  643.  
  644. ---------------------------
  645.  
  646. >From grantd@dcs.gla.ac.uk (Dair Grant)
  647. Subject: Extension Shell 1.3 - Help for INIT writers
  648. Date: Wed, 27 Apr 1994 16:45:51 GMT
  649. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  650.  
  651. Extension Shell is a library of source code for writing System 7
  652. Extensions. Full source code is provided, as well as six sample
  653. Extensions demonstrating how to write Extensions with Extension
  654. Shell.
  655.  
  656.  
  657. Extension Shell acts as an Extension-independent loading mechanism.
  658. It takes care of the generic stuff needed by all Extensions (showing
  659. icons, installing things into the System Heap, posting Notification
  660. Manager messages), and reduces the amount of coding needed to produce
  661. new Extensions.
  662.  
  663.  
  664. To write an Extension with Extension Shell, you just decide what you
  665. want installed, compile it into a code resource, and paste in
  666. Extension Shell. Trap patches, VBL tasks, Shutdown tasks, Time
  667. Manager tasks, Gestalt selectors, low-memory filters (e.g., jGNEFilter),
  668. and blocks of code can all be installed through a simple
  669. "fill out the details in a table" mechanism. It requires THINK C 6.0.
  670.  
  671.  
  672.  
  673. -dair
  674.  
  675. - -------------------+--------------------------------------------------------
  676. Dair Grant           | There are two major products that come out of Berkeley:
  677. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  678. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  679. - -------------------+--------------------------------------------------------
  680.  
  681. +++++++++++++++++++++++++++
  682.  
  683. >From grantd@dcs.gla.ac.uk (Dair Grant)
  684. Date: Wed, 27 Apr 1994 17:30:24 GMT
  685. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  686.  
  687. grantd@dcs.gla.ac.uk (Dair Grant) writes:
  688.  
  689. >Extension Shell is a library of source code for writing System 7
  690. >Extensions. Full source code is provided, as well as six sample
  691. >Extensions demonstrating how to write Extensions with Extension
  692. >Shell.
  693.  
  694.     [munch]
  695.  
  696.  
  697. Ooops. I forgot to mention that I've sent it off to macgifts. It
  698. should be showing up there within a couple of days. Too many
  699. late nights trying to get my final year project finished... :-(
  700.  
  701.  
  702.  
  703. -dair
  704.  
  705. - -------------------+--------------------------------------------------------
  706. Dair Grant           | There are two major products that come out of Berkeley:
  707. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  708. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  709. - -------------------+--------------------------------------------------------
  710.  
  711. ---------------------------
  712.  
  713. >From andys@nsrvan.van.wa.us
  714. Subject: FFT benchmark using CodeWarrior
  715. Date: 26 Apr 94 08:58:24 PST
  716. Organization: National Systems & Research, Vancouver WA
  717.  
  718. I ran the FFT benchmark which was posted to comp.sys.powerpc by
  719. whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  720. including a PowerMac 6100/60. I compiled the program using 
  721. CodeWarrior DR2 which uses the Apple math library. I also am 
  722. including the SpecInt and SpecFP results which gsnow@clark.edu
  723. posted earlier:
  724.  
  725. these FFT results are from whitney@galileo.Meakins.McGill.CA:
  726.  
  727.                                   FFT Time     SpecInt   SpecFP
  728.  
  729.     RS6000 Model 320                 55.0       20.9      39.4
  730.     RS6000 Model 530                 41.0       28.5      64.6
  731.     RS6000 Model 250                 40.0       62.6      72.2
  732.     RS6000 Model 590                 18.0      117.0     242.4
  733.  
  734. These are the results from the tests I ran. Notice I ran with
  735. and without the compilers optimizer turned on:
  736.  
  737.     RS6000 Model 550 (Opt)           25.0       35.4      71.7
  738.     RS6000 Model 550 (No-Opt)        61.0       35.4      71.7
  739.     Decstation 5000/260 (Opt)        46.0       57.1      54.5
  740.     Decstation 5000/260 (No-Opt)     56.0       57.1      54.5
  741.     Decstation 5000/240 (Opt)        99.0       27.9      35.8
  742.     Dec3000 Alpha 300L (OVMS-Opt)    54.0       45.9      63.6
  743.     Dec3000 Alpha 300L (OVMS-NoOpt) 125.0       45.9      63.6
  744.     Dec3100/90 (VMS No-Opt)         133.0       ????      ????
  745.     Dec3100/90 (VMS Opt)            108.0       ????      ????
  746.     
  747.     PowerMac 6100/60 (No-Opt)        66.0      ~55.0     ~73.0
  748.     PowerMac 6100/60 (Opt)           65.0      ~55.0     ~73.0
  749.     PowerMac 6100/60 (Opt/double_t)  77.0      ~55.0     ~73.0
  750.  
  751. I think this is very interesting because it tells me that the
  752. CodeWarrior optimizer has a LONG way to go. Notice what the
  753. RS6000 Model 550 did using xlc with and without the optimizer.
  754. The optimizer gave a 244% speedup. The PowerMac with no optimization
  755. did almost as well as the RS6000 Model 550 without optimization.
  756. I think we have a lot to look forward to as CodeWarrior progesses!!
  757.  
  758. Another note, the FFT program uses floats, I tried to change these
  759. floats to double_t and the time came out to 77.0 with the optimizer
  760. turned on. I also tried changing the struct alignment just for
  761. the heck of it and all three settings [PowerPC, 68k, 68k 4-byte]
  762. all came out with the same times.
  763.  
  764. One more note, when I say optimizations above I meant I turned on
  765. the highest level of optimization each compiler has.
  766.  
  767.  
  768. +++++++++++++++++++++++++++
  769.  
  770. >From usenet@lowry.eche.ualberta.ca (Brian Lowry)
  771. Date: 26 Apr 1994 22:39:43 GMT
  772. Organization: Chem Eng - Univ of Alberta
  773.  
  774. In article <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us
  775. wrote:
  776.  
  777. > I think this is very interesting because it tells me that the
  778. > CodeWarrior optimizer has a LONG way to go.
  779.  
  780.   I was under the impression that the DR2 CodeWarrior C compiler did not
  781. actually have optimization implemented, regardless of the project settings.
  782.  You might want to contact MetroWerks and ask them.  I haven't seen any
  783. evidence of optimization in low-level stuff...
  784.  
  785. -- 
  786.  
  787. Brian Lowry
  788.  
  789. +++++++++++++++++++++++++++
  790.  
  791. >From ameline@provence.torolab.ibm.com (Ian R. Ameline)
  792. Date: 27 Apr 1994 00:09:05 GMT
  793. Organization: C-Set++ Development, IBM Canada Laboratory.
  794.  
  795. In <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us writes:
  796.  
  797. [Performance Numbers deleted]
  798.  
  799. >I think this is very interesting because it tells me that the
  800. >CodeWarrior optimizer has a LONG way to go. Notice what the
  801. >RS6000 Model 550 did using xlc with and without the optimizer.
  802.  
  803.    Well, IBM has been writing optimizing compilers for over 20 years. 
  804. I believe the current XLC optimizer has been in development for around 
  805. 10 years, with some really bright people involved with it. There 
  806. should be little surprise that we're good at this sort of thing.
  807.                                                                                   
  808. >The optimizer gave a 244% speedup. The PowerMac with no optimization
  809. >did almost as well as the RS6000 Model 550 without optimization.
  810. >I think we have a lot to look forward to as CodeWarrior progesses!!
  811.  
  812.    I've heard an unconfirmed rumour on the net that they've licenced 
  813. some IBM optimization technology. I don't know if it's true or not, 
  814. but if it is, perhaps your last sentence is correct.
  815.  
  816. Regards,                  | "Once you have flown, you will walk the earth with
  817. Ian R. Ameline, PP-ASEL   |  your eyes turned skyward, for there you have been,
  818. (speaking for myself only)|  and there you long to return" -- Leonardo DaVinci
  819. ViaCrypt PGP Key fingerprint = 3B B8 CF E9 CA 1B 9C 75  01 7F B2 64 10 7F 96 85   
  820.  
  821.  
  822. +++++++++++++++++++++++++++
  823.  
  824. >From Tigger <greg@pomona.claremont.edu>
  825. Date: Tue, 26 Apr 1994 03:45:25 GMT
  826. Organization: Pomona College
  827.  
  828. In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  829. ameline@provence.torolab.ibm.com writes:
  830. >
  831. >    I've heard an unconfirmed rumour on the net that they've licenced 
  832. > some IBM optimization technology.
  833.  
  834. I read it in at least two different trade rags, and it was reported
  835. as news, not rumors.  I believe one of the articles included quotes
  836. from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  837.  
  838. --
  839. |  Greg Orman                         greg@pomona.claremont.edu  |
  840. |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  841.  
  842. +++++++++++++++++++++++++++
  843.  
  844. >From johnmce@world.std.com (John McEnerney)
  845. Date: Wed, 27 Apr 1994 15:54:38 GMT
  846. Organization: The World Public Access UNIX, Brookline, MA
  847.  
  848. >Another note, the FFT program uses floats, I tried to change these
  849. >floats to double_t and the time came out to 77.0 with the optimizer
  850. >turned on.
  851.  
  852. On the PowerPC, 'float' is usually faster than 'double', particularly 
  853. with multiply/divide instructions.
  854.  
  855. >The PowerMac with no optimization
  856. >did almost as well as the RS6000 Model 550 without optimization.
  857.  
  858. This is definitely attributable to the 550 being faster. When 
  859. optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  860. makes little use of registers when optimization is turned off)
  861.  
  862. >I think we have a lot to look forward to as CodeWarrior progesses!!
  863.  
  864. The current version so CodeWarrior actually do almost no optimization 
  865. beyond global register allocation. This can make some programs faster, 
  866. but because of the plentiful registers on the PowerPC it does not make an 
  867. improvement in many cases. Future versions wil include all of 
  868. the usual optimizations.
  869.  
  870. -- John
  871.  
  872.  
  873. +++++++++++++++++++++++++++
  874.  
  875. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  876. Date: 27 Apr 1994 19:48:49 GMT
  877. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  878.  
  879. In article <A9E32DE57E0104A7@taz.claremont.edu> Tigger <greg@pomona.claremont.edu> writes:
  880. >
  881. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  882. > ameline@provence.torolab.ibm.com writes:
  883. > >
  884. > >    I've heard an unconfirmed rumour on the net that they've licenced 
  885. > > some IBM optimization technology.
  886. >
  887. > I read it in at least two different trade rags, and it was reported
  888. > as news, not rumors.  I believe one of the articles included quotes
  889. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  890.  
  891. John McEnerey (from Metrowerks) attempted to clarify the articles that
  892. were published.  these articles implied that Metrowerks has licensed
  893. some of IBM's code.  this is not the case.
  894.  
  895. included is an excerpt from John's original post.
  896.  
  897. -gary
  898.  
  899.  
  900. [QUOTED MESSAGE FOLLOWS]
  901.  
  902. Newsgroups: comp.sys.mac.programmer
  903. Path: usenet.ins.cwru.edu!eff!news.kei.com!world!johnmce
  904. From: johnmce@world.std.com (John McEnerney)
  905. Subject: Re: Metrowerks News from MacWEEK
  906. Message-ID: <CnzIH7.FoC@world.std.com>
  907. Organization: The World Public Access UNIX, Brookline, MA
  908. References: <Cnz0JL.5v9@zcias2.ziff.com> <9404090108.AA09272@geweke.ppp.msu.edu>
  909. Date: Sat, 9 Apr 1994 09:03:06 GMT
  910. Lines: 44
  911.  
  912. > Metrowerks has formed an agreement with IBM which gives Metrowerks 
  913. > access to Big Blue's compiler optimization technology for current and 
  914. > future PowerPC processors. As a result, Mac developers will have access 
  915. > to the best PowerPC code generators available, said Jean Belanger, 
  916. > Metrowerks' chairman. "In addition to having the fastest compiler, we'
  917. > ll be able to generate the fastest code," he said. 
  918.  
  919. So that the rumours don't fly to far too fast on this one, let me clarify 
  920. the situation as it will affect you, the users.
  921.  
  922. We have an agreement which says that as I develop the next version 
  923. of our PowerPC code generator, I'm free to ask for advice, experiences, 
  924. etc. from some of the guys at IBM's Watson Research Center where the 
  925. POWER architecture was originally designed. It turns out much of my 
  926. current code generator design is already based on some papers that they 
  927. wrote at Watson anyway. They are willing to be pretty free with their 
  928. experience, but I imagine they will also keep some tricks to themselves.
  929.  
  930. No source code is involved, at least not to my knowledge.
  931.  
  932. [... rest deleted ...]
  933.  
  934.  
  935.  
  936. +++++++++++++++++++++++++++
  937.  
  938. >From zstern@adobe.com (Zalman Stern)
  939. Date: Wed, 27 Apr 1994 21:59:22 GMT
  940. Organization: Adobe Systems Incorporated
  941.  
  942. John McEnerney writes
  943. > This is definitely attributable to the 550 being faster. When 
  944. > optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  945. > makes little use of registers when optimization is turned off)
  946.  
  947. I've observed that if you have debugging information turned on and  
  948. optimization turned off, xlc goes out of its way to generate *exactly* the  
  949. seqeunce of operations you wrote in your program. This means that variables  
  950. are "homed" to their memory locations at the end of each line of code if  
  951. they are modified. Variables also seem to be preserved as live to the end of  
  952. their declared scope. The result of these things is a rather inefficient but  
  953. easy to debug program. I never compile with both optimization and debug  
  954. symbols off so I don't know if this is a property of turning optimization  
  955. off, or a property of turning debugging on with optimization off.
  956. --
  957. Zalman Stern           zalman@adobe.com            (415) 962 3824
  958. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  959.           There is no lust like the present.
  960.  
  961. +++++++++++++++++++++++++++
  962.  
  963. >From whitney@galileo.Meakins.McGill.CA ()
  964. Date: Thu, 28 Apr 1994 02:40:14 GMT
  965. Organization: McGill University
  966.  
  967. andys@nsrvan.van.wa.us wrote:
  968. : I ran the FFT benchmark which was posted to comp.sys.powerpc by
  969. : whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  970. : including a PowerMac 6100/60.
  971.  
  972. : I think this is very interesting because it tells me that the
  973. : CodeWarrior optimizer has a LONG way to go. 
  974.  
  975. I have also draw this conclusion, but this well known.
  976. One has be careful on what conclusions one draws from this simple
  977. benchmark. My intention was to use it as sanity check against
  978. the numbers I have in magazines and on the net. The benchmark
  979. was intended to simulate the number crunching efforts of researchers
  980. in our respiratory research lab. We have data sets that usually
  981. larger than most caches so I included that in my benchmark. Those
  982. that takes benchmarks seriously would say that this makes the benchmark
  983. meaningless and that it does little more than detect the presence
  984. or absence of a 512 K cache. ( Perhaps it is the case that all our
  985. research efforts amount to little more than detecting 512K caches :-) )
  986. Of course, running code in a memory bound fashion tends to diminish the 
  987. advantage of the super-scalar designs particularly more sophisticated
  988. designs such as the POWER2 machines ( as seen the benchmarks ).
  989.  
  990. Furthermore the fft implementation is a very simple one. It has
  991. not been reworked for data that exceeds the cache size. Again 
  992. this was deliberate on my part. More often than not we use simple
  993. coding techniques. 
  994.  
  995. : One more note, when I say optimizations above I meant I turned on
  996. : the highest level of optimization each compiler has.
  997.  
  998. I used cc -O only because we may move binaries from
  999. machine to machine - perhaps from the RS6000 to the PowerMac.
  1000.  
  1001. Whitney
  1002.  
  1003. +++++++++++++++++++++++++++
  1004.  
  1005. >From 103t_english@west.cscwc.pima.edu
  1006. Date: 27 Apr 94 23:06:02 MST
  1007. Organization: (none)
  1008.  
  1009. In article <A9E32DE57E0104A7@taz.claremont.edu>, Tigger <greg@pomona.claremont.edu> writes:
  1010. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  1011. > ameline@provence.torolab.ibm.com writes:
  1012. >>
  1013. >>    I've heard an unconfirmed rumour on the net that they've licenced 
  1014. >> some IBM optimization technology.
  1015. > I read it in at least two different trade rags, and it was reported
  1016. > as news, not rumors.  I believe one of the articles included quotes
  1017. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  1018. > --
  1019. > |  Greg Orman                         greg@pomona.claremont.edu  |
  1020. > |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  1021.  
  1022.  
  1023.  
  1024. On AOL, the architect of the CodeWarrior C/C++ came out and clarified issues.
  1025. He won't be able to do much until next year at the earliest...
  1026.  
  1027. Lawson
  1028.  
  1029. +++++++++++++++++++++++++++
  1030.  
  1031. >From johnmce@world.std.com (John McEnerney)
  1032. Date: Thu, 28 Apr 1994 06:24:57 GMT
  1033. Organization: The World Public Access UNIX, Brookline, MA
  1034.  
  1035. usenet@lowry.eche.ualberta.ca (Brian Lowry) writes:
  1036.  
  1037. >  I was under the impression that the DR2 CodeWarrior C compiler did not
  1038. >actually have optimization implemented, regardless of the project settings.
  1039. > You might want to contact MetroWerks and ask them.  I haven't seen any
  1040. >evidence of optimization in low-level stuff...
  1041.  
  1042. The DR2 and DR3 versions of CodeWarrior (for PowerPC) have no real 
  1043. optimizations. I use the Global Optimization option as a catch-all for 
  1044. anything that is likely to slow down the compiler. For now, it only 
  1045. controls global register allocation. This does quite a nice job of 
  1046. cleaning up your register usage (for example, variables with disjoint 
  1047. lifetimes will get the same register, and it does a pretty good job with 
  1048. function calls) but usually does not provide a significant performance 
  1049. increase because there are so many registers on the PowerPC.
  1050.  
  1051. Although this is not a huge optimization, the algorithm is O(N^2) so it 
  1052. tends to slow the compiler down quite a bit, which is why the smart 
  1053. register allocator isn't used all the time.
  1054.  
  1055. DR4 will probably add some common subexpression elimination.
  1056.  
  1057. Future versions will add the traditional global optimizations, which will 
  1058. slow down the compiler quite a bit more when they are enabled.
  1059.  
  1060. -- John McEnerney, Metrowerks PowerPC Product Architect
  1061.  
  1062.  
  1063. ---------------------------
  1064.  
  1065. >From rjc@crosfield.co.uk (Roger Clark)
  1066. Subject: How do I find the window colour ???
  1067. Date: Thu, 28 Apr 1994 11:05:40 GMT
  1068. Organization: Crosfield, Hemel Hempstead, UK
  1069.  
  1070. Hi,
  1071.    I'm trying to find out what "Window colour" has been set by the "Colour" 
  1072. control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1073. an attempt to get the "default" window information, but this gives colours
  1074. of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1075. components (like content,frame,text,highlight and title bar).
  1076.  
  1077. Does anyone know what I'm doing wrong, or have a better solution.
  1078.  
  1079.  
  1080. Thanks in advance.
  1081.             Roger Clark.
  1082.  
  1083. +++++++++++++++++++++++++++
  1084.  
  1085. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  1086. Date: Thu, 28 Apr 94 17:10:45 GMT
  1087. Organization: National Renewable Energy Laboratory
  1088.  
  1089. In article <1994Apr28.110540.5738@crosfield.co.uk> Roger Clark,
  1090. rjc@crosfield.co.uk writes:
  1091. >   I'm trying to find out what "Window colour" has been set by the
  1092. "Colour" 
  1093. >control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1094. >an attempt to get the "default" window information, but this gives
  1095. colours
  1096. >of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1097. >components (like content,frame,text,highlight and title bar).
  1098.  
  1099. Two items on ftp.apple.com should give you the information you require:
  1100.  
  1101.   *  Tech Note TB 33 - "Color, Windows and 7.0"
  1102.   *  DTS code snippet "WDEFColorSample"
  1103.  
  1104. +++++++++++++++++++++++++++
  1105.  
  1106. >From devon_hubbard@taligent.com (Devon Hubbard)
  1107. Date: Thu, 28 Apr 1994 17:32:40 GMT
  1108. Organization: Taligent, Inc.
  1109.  
  1110. In article <1994Apr28.110540.5738@crosfield.co.uk>, rjc@crosfield.co.uk
  1111. (Roger Clark) wrote:
  1112.  
  1113. > Hi,
  1114. >    I'm trying to find out what "Window colour" has been set by the "Colour" 
  1115. > control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1116. > an attempt to get the "default" window information, but this gives colours
  1117. > of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1118. > components (like content,frame,text,highlight and title bar).
  1119. > Does anyone know what I'm doing wrong, or have a better solution.
  1120. > Thanks in advance.
  1121. >             Roger Clark.
  1122.  
  1123. Have you seen Infinity Windoid yet?  He supports the floating window being
  1124. the color that the system has assigned and, giving full credit here to Troy
  1125. Gaul, here's how he does it.
  1126.  
  1127. - ---
  1128. static void 
  1129. GetWctbColor(WindowPeek window, short partCode, RGBColor *theColor) {
  1130.     //    Given a partCode, return the RGBColor associated with it. (Using the
  1131.     //    default window color table.)
  1132.     AuxWinHandle awHndl;
  1133.     short count;
  1134.     
  1135.     //    Get the Color table for the window if it has one.
  1136.  
  1137.     (void) GetAuxWin((WindowPtr) window, &awHndl); 
  1138.     count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1139.     
  1140.  
  1141.     //    If the table didn't contain the entry of interest, look to the 
  1142.     //    default table.
  1143.     
  1144.     if (count < partCode) {
  1145.         GetAuxWin(nil, &awHndl); 
  1146.         count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1147.     }
  1148.             
  1149.  
  1150.     //    If the entry is there, use it, if not make a best guess at a default
  1151. value.
  1152.  
  1153.     if (count < partCode)
  1154.         UseDefaultColor(partCode, theColor);
  1155.     else
  1156.         *theColor = (**(WCTabHandle)
  1157. ((**awHndl).awCTable)).ctTable[partCode].rgb;
  1158. }
  1159. - ----
  1160.  
  1161. You might want to get his cool Infinity Windoid archive from your nearest
  1162. site so you can see everything he's doing.
  1163.  
  1164. - ------------------------------------------------------------------------
  1165. Devon Hubbard                                                Silicon Pilot
  1166. devon_hubbard@taligent.com                                   Taligent, Inc
  1167.  
  1168. ---------------------------
  1169.  
  1170. >From tonym@netcom.com (Tony Mann)
  1171. Subject: Private inheritance faulty in SC++ 7.0
  1172. Date: Wed, 27 Apr 1994 21:58:51 GMT
  1173. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1174.  
  1175. Using SC++ 7.0, the following code should not compile, but it does:
  1176.  
  1177. class Bag
  1178. {
  1179. public:
  1180.   Bag();
  1181.   int GetCount() { return count; }
  1182. private:
  1183.   int count;
  1184. };
  1185.  
  1186. class Set: private Bag  // note "private" keyword
  1187. {
  1188. public:
  1189.   Set();
  1190. };
  1191.  
  1192. int foo(Bag& b)
  1193. {
  1194.   return b.GetCount();
  1195. }
  1196.  
  1197. main()
  1198. {
  1199.   Bag *b = new Set;     // ** should generate error; it does not
  1200.   Set s;
  1201.   foo(s);               // ** should generate error; it does not
  1202.   return 0;
  1203. }
  1204.  
  1205. The compiler is allowing a Set to be implicitly converted to a Bag;
  1206. this should not be allowed, since Set privately inherits from Bag.
  1207.  
  1208. Symantec has been notified.
  1209.  
  1210. - Tony Mann
  1211.  
  1212. ---------------------------
  1213.  
  1214. >From David Plumpton <plumpto@bnr.ca>
  1215. Subject: Source Control Questions
  1216. Date: Tue, 19 Apr 1994 03:12:09 GMT
  1217. Organization: NorTel
  1218.  
  1219. Are there any real alternatives to using MPW projector?
  1220. If you had to manage a multiplatform project using Macintosh,
  1221. Unix and Windows, which source control system on which
  1222. platform would you choose?
  1223.  
  1224. Thanks in advance.
  1225. - -----------
  1226. David Plumpton: plumpto@bnr.ca
  1227. "I'm a New Zealand Zoo Official, and this monkey's going to Newton!"
  1228.  
  1229. +++++++++++++++++++++++++++
  1230.  
  1231. >From rgc3679@halcyon.halcyon.com (Bob Carpenter)
  1232. Date: 20 Apr 1994 19:42:23 GMT
  1233. Organization: A World of Information at Your Fingertips
  1234.  
  1235. In article <1994Apr19.031209.7354@bnr.ca>,
  1236. David Plumpton  <plumpto@bnr.ca> wrote:
  1237. >Are there any real alternatives to using MPW projector?
  1238. >If you had to manage a multiplatform project using Macintosh,
  1239. >Unix and Windows, which source control system on which
  1240. >platform would you choose?
  1241. >
  1242.  
  1243.  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1244.  you can tailor it to your liking.
  1245.  
  1246.  See the sccs man pages for the details.
  1247.  
  1248. --BobC
  1249.  
  1250. +++++++++++++++++++++++++++
  1251.  
  1252. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  1253. Date: Thu, 21 Apr 94 09:52:55 GMT
  1254. Organization: Network Analysis Ltd
  1255.  
  1256.  
  1257. In article <2p40iv$d1f@nwfocus.wa.com> (comp.sys.mac.programmer), rgc3679@halcyon.halcyon.com (Bob Carpenter) writes:
  1258. > In article <1994Apr19.031209.7354@bnr.ca>,
  1259. > David Plumpton  <plumpto@bnr.ca> wrote:
  1260. > >Are there any real alternatives to using MPW projector?
  1261. > >If you had to manage a multiplatform project using Macintosh,
  1262. > >Unix and Windows, which source control system on which
  1263. > >platform would you choose?
  1264. > >
  1265. >  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1266. >  you can tailor it to your liking.
  1267.  
  1268. You cannot be serious: the contortions you have to go through just to
  1269. mark a set of versions as belonging to a particular release! (Yes, I
  1270. know about the
  1271.  
  1272.     what prog > prog.slist
  1273.  
  1274. trick :-()
  1275.  
  1276. Anyway, I've just come off a Windows/Mac project straight into another one, so
  1277. the issue is very much on my mind. The main problems with using a non-Mac source
  1278. control system are
  1279.  
  1280. a) filename lengths
  1281.  
  1282. For the first project, we used PVCS on a PC-compatible. Using LAN Mgr for
  1283. the Mac, we mounted the PC vols on the Mac desktop, and saved our src files
  1284. there. We then hopped on to a PC to check stuff in and out. Even though LAN
  1285. Mgr lets you use full Mac filenames, when we came to use PVCS we discovered
  1286. very quickly that we had to use 8.3 filenames. That meant chasing through
  1287. all our makefiles, .r files &c - bugs from which are still haunting me (some
  1288. of the files, like .r files only get rebuilt very occasionally).
  1289.  
  1290. b) they destroy the Mac rez fork
  1291.  
  1292. I knew that we couldn't save rsrc files in PVCS, so I had a couple of small
  1293. MPW scripts that derez'ed rsrc files before saving them on the PC volume.
  1294. Well, that worked, but we then found that when we checked stuff back out of
  1295. PVCS that we had lost all our tab settings, font settings, and most important,
  1296. our MPW markers in every source file. (Sound of grinding teeth...)
  1297.  
  1298. My current project uses SCCS, and we are going to have similar problems.
  1299. Anyway, the last time this subject came up, Tom Emerson of Symantec pointed
  1300. me at
  1301.  
  1302.       SourceSafe by
  1303.           OneTree Software
  1304.           P.O. Box 11639
  1305.           Raleigh, NC 27604
  1306.           USA
  1307.  
  1308.           (919)-821-2300
  1309.           fax (919)-821-5222
  1310.  
  1311. I didn't get a chance to follow this up, though I will do this time (promise,
  1312. really, honest :-).
  1313.  
  1314. Another possiblility you might like to look at is RCS - there is a Mac port
  1315. by Tim Endres, available from nic.switch.ch or ftp.msen.com (in /pub/vendors/ice).
  1316. Please report any experiences with this, especially if you've used it on a
  1317. real project.
  1318.  
  1319. Actually, I quite like Projector, especially when backed up with suitable MPW
  1320. scripts (look for DTS Goodies on a developer CD). I don't see why it can't
  1321. be used for storing Unix and Windows src files, since Projector, unlike SCCS
  1322. can hold binary files.
  1323.  
  1324.  
  1325. Sak Wathanasin
  1326. Network Analysis Limited
  1327. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  1328.  
  1329. Internet: sw@network-analysis-ltd.co.uk 
  1330. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  1331. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  1332.  
  1333. +++++++++++++++++++++++++++
  1334.  
  1335. >From xxx (Christoph Reichenberger)
  1336. Date: Mon, 25 Apr 1994 07:10:27 GMT
  1337. Organization: Uni Software Plus
  1338.  
  1339. In article <2p40iv$d1f@nwfocus.wa.com>, rgc3679@halcyon.halcyon.com (Bob
  1340. Carpenter) wrote:
  1341.  
  1342. > In article <1994Apr19.031209.7354@bnr.ca>,
  1343. > David Plumpton  <plumpto@bnr.ca> wrote:
  1344. > >Are there any real alternatives to using MPW projector?
  1345. > >If you had to manage a multiplatform project using Macintosh,
  1346. > >Unix and Windows, which source control system on which
  1347. > >platform would you choose?
  1348. > >
  1349.  
  1350. Voodoo (the name stands for Versions Of Outdated Documents Organized
  1351. Orthogonally) is a (Mac) version management tool for the simple and clear
  1352. management of projects in which files are created in numerous versions
  1353. (variants and revisions). Since Voodoo is capable of managing
  1354. arbitrary files, the program can be employed for more than just the
  1355. organization of software projects in a narrow sense (program
  1356. development). Even the writing of a book, for example, is a project in
  1357. which multiple elementary building blocks (the individual chapters,
  1358. illustrations, etc.) evolve in various revisions. Using Voodoo can
  1359. also pay off here.
  1360.  
  1361. Voodoo allows both variant and revision control, and it
  1362. manages not only variants and revisions of single files, but
  1363. of a whole software project (multi files, multi users,
  1364. multi variants, access rights, ...).
  1365.  
  1366. The tool offers a neat graphical user interface and is not only
  1367. suitable for mere source code control but can handle all
  1368. different kinds of files with amazing compression rates:
  1369.  
  1370.           typical size of delta between arbitrary files
  1371.                5% (in words:  five per cent)  !!!!
  1372.  
  1373. no matter whether the files are plain text or any other
  1374. documents - e. g. MSWord, WriteNow, Canvas, FileMaker ...).
  1375. Contrary, if you try to manage non-text-files with Projector
  1376. or SCCS you will not get any space reduction.
  1377.  
  1378. Voodoo differs from previous source code control systems in its
  1379. orthogonal approach to version management. This means that for
  1380. every component of a project hierarchy you can not only store
  1381. its revision history but also different variants of the same
  1382. component.The orthogonal organization of revisions and
  1383. variants leads to a much clearer organization that with other
  1384. RCS/SCCS-based tools like Projector/SourceServer and others.
  1385.  
  1386. A lite version of Voodoo is being distributed on a shareware basis (30 $).
  1387. The package included contains VoodooLite 1.5 together with a
  1388. readme document and a manual.
  1389.  
  1390. You can get the current version directly from our ftp-server at:
  1391.   ftp.swe.uni-linz.ac.at    in /pub/voodoo
  1392.  
  1393. Additionally it should be available via ftp at least at the
  1394. following sites:
  1395.   sumex-aim.stanford.edu    in /info-mac/dev
  1396.   mac.archive.umich.edu     in /mac/util/organization
  1397.  
  1398. The full (commercial) version of Voodoo is being distributed
  1399. world-wide by:
  1400.  
  1401.    UNI Software Plus
  1402.    Softwarepark Hagenberg
  1403.    A-4232 Hagenberg
  1404.    AUSTRIA (Europe)
  1405.    Fax.: +43 (7236) 37 69
  1406.    EMail: voodoo@unisoft.co.at
  1407.  
  1408. For further information on Voodoo Lite or on the full version
  1409. please contact the author:
  1410.  
  1411.     Christoph Reichenberger      Tel:      +43-7262-2166
  1412.                  Erlenweg 2      Fax:      +43-7236-3338-30
  1413.        A-4320 Perg, Austria      Internet: chrei@unisoft.co.at
  1414.                                                                                     
  1415.  
  1416. Feel free to contact me, if you have further questions concerning Voodoo.
  1417.  
  1418. Christoph, the author of Voodoo
  1419.  
  1420.  
  1421. +++++++++++++++++++++++++++
  1422.  
  1423. >From hoshi@sra.co.jp (Hoshi Takanori)
  1424. Date: 27 Apr 94 11:34:50
  1425. Organization: Software Research Associates, Inc.,Japan
  1426.  
  1427. In article <1994Apr19.031209.7354@bnr.ca> David Plumpton <plumpto@bnr.ca> writes:
  1428.  
  1429. > Are there any real alternatives to using MPW projector?
  1430. > If you had to manage a multiplatform project using Macintosh,
  1431. > Unix and Windows, which source control system on which
  1432. > platform would you choose?
  1433.  
  1434. I've just started using RCS on my MacMiNT.  It's great!
  1435.  
  1436. hoshi
  1437.  
  1438. ---------------------------
  1439.  
  1440. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1441. Subject: Using xlc to generate PowerMacintosh code
  1442. Date: 15 Apr 1994 00:36:24 GMT
  1443. Organization: Univ of Wisc-Madison
  1444.  
  1445. I have access to an RS/6000 with the xlc compiler.  My
  1446. question is how do I use this compiler to generate
  1447. code for the mac.  Could someone with experience in
  1448. this area please give me some pointers?
  1449.  
  1450. Thanks,
  1451. Ken Prehoda
  1452. kenp@nmrfam.wisc.edu
  1453.  
  1454. +++++++++++++++++++++++++++
  1455.  
  1456. >From creiman@netcom.com (Charlie Reiman)
  1457. Date: Fri, 15 Apr 1994 07:15:24 GMT
  1458. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1459.  
  1460. Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1461.  
  1462. >I have access to an RS/6000 with the xlc compiler.  My
  1463. >question is how do I use this compiler to generate
  1464. >code for the mac.  Could someone with experience in
  1465. >this area please give me some pointers?
  1466.  
  1467. You can't, really. The xlc that apple is giving to developers is
  1468. modified to support the pascal keyword (ignored), #pragma align=68k
  1469. (very important), and pascal strings (also important). Also, their xlc
  1470. generates instructions for the PowerPC which probably isn't an option
  1471. on older versions of xlc.
  1472.  
  1473. If you don't need any of these, then you can generate .o files, then
  1474. drop those into an MPW development environment and use the usual
  1475. makepef, ppclink, et al. If you can get the inside track SDK, it's
  1476. actually pretty cool (if you are an unix hacker, anyway).  I've
  1477. always wanted to cross compile my mac apps under unix. Now, I can.
  1478.  
  1479. -- 
  1480. "You can't cancel the project! We already made the T-shirts!"
  1481. Charlie Reiman
  1482. creiman@netcom.com
  1483.  
  1484. +++++++++++++++++++++++++++
  1485.  
  1486. >From mgleason@cse.unl.edu (Mike Gleason)
  1487. Date: 15 Apr 1994 11:13:39 GMT
  1488. Organization: NCEMRSoft
  1489.  
  1490. creiman@netcom.com (Charlie Reiman) writes:
  1491.  
  1492. |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1493. |>I have access to an RS/6000 with the xlc compiler. My question is how
  1494. |>do I use this compiler to generate code for the mac. Could someone with
  1495. |>experience in this area please give me some pointers?
  1496.  
  1497. |You can't, really. The xlc that apple is giving to developers is
  1498. |modified to support the pascal keyword (ignored), #pragma align=68k
  1499. |(very important), and pascal strings (also important). Also, their xlc
  1500. |generates instructions for the PowerPC which probably isn't an option
  1501. |on older versions of xlc.
  1502.  
  1503. Too bad... one could write a preprocessor that could handle the 'pascal'
  1504. and pascal strings, then use that before the cpp for xlc.  Can't get
  1505. around the #pragma align=68k or PowerPC generation, though.
  1506.  
  1507. |If you don't need any of these, then you can generate .o files, then
  1508. |drop those into an MPW development environment and use the usual
  1509. |makepef, ppclink, et al. If you can get the inside track SDK, it's
  1510. |actually pretty cool (if you are an unix hacker, anyway).  I've
  1511. |always wanted to cross compile my mac apps under unix. Now, I can.
  1512.  
  1513. Me too.  One thing I did just figure out how to do, which has nothing
  1514. to do with PowerPC, is send my mac code over to a unix box and run
  1515. lint on it, or actually "compile" my mac code with gcc for sole purpose
  1516. of seeing all the cool warnings it spews.  Seems kind of silly, but
  1517. the only mac compiler I can use right now is Think C 5, which doesn't
  1518. give me warning messages.
  1519.  
  1520. --
  1521. --mg                                                      mgleason@cse.unl.edu
  1522.  
  1523. +++++++++++++++++++++++++++
  1524.  
  1525. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1526. Date: 15 Apr 1994 14:58:51 GMT
  1527. Organization: Univ of Wisc-Madison
  1528.  
  1529. <creimanCoAHHp.C90@netcom.com> Charlie Reiman, creiman@netcom.com writes:
  1530. >You can't, really. The xlc that apple is giving to developers is
  1531. >modified to support the pascal keyword (ignored), #pragma align=68k
  1532. >(very important), and pascal strings (also important). Also, their xlc
  1533. >generates instructions for the PowerPC which probably isn't an option
  1534. >on older versions of xlc.
  1535.  
  1536. Thanks for the info.  The version of xlc that I have will 
  1537. align=68k and will also generate instructions for the 601.
  1538. Also, I can get rid of the pascal keyword easy enough.  
  1539. In other words, I think I can get it to do all of the things
  1540. that you say.  However, is it possible to compile a complete
  1541. mac application on the RS/6000 (i.e. I don't have MPW)?
  1542.  
  1543.  
  1544. >If you don't need any of these, then you can generate .o files, then
  1545. >drop those into an MPW development environment and use the usual
  1546. >makepef, ppclink, et al. If you can get the inside track SDK, it's
  1547. >actually pretty cool (if you are an unix hacker, anyway).  I've
  1548. >always wanted to cross compile my mac apps under unix. Now, I can.
  1549.  
  1550. Me too.  And that's the main reason I'm even bothering with all this.
  1551. Not to mention how much I like xlc.
  1552.  
  1553. Thanks again,
  1554. Ken Prehoda
  1555. kenp@nmrfam.wisc.edu
  1556.  
  1557. +++++++++++++++++++++++++++
  1558.  
  1559. >From proth@toto.cs.uiuc.edu (Phil Roth)
  1560. Date: Fri, 15 Apr 1994 16:10:22 GMT
  1561. Organization: Picasso Group, DCS, University of Illinois, Urbana-Champaign
  1562.  
  1563. In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike Gleason) writes:
  1564. |> creiman@netcom.com (Charlie Reiman) writes:
  1565. |> 
  1566. |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1567. |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1568. |> |>do I use this compiler to generate code for the mac. Could someone with
  1569. |> |>experience in this area please give me some pointers?
  1570. |> 
  1571. |> |You can't, really. The xlc that apple is giving to developers is
  1572. |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1573. |> |(very important), and pascal strings (also important). Also, their xlc
  1574. |> |generates instructions for the PowerPC which probably isn't an option
  1575. |> |on older versions of xlc.
  1576. |> 
  1577. |> Too bad... one could write a preprocessor that could handle the 'pascal'
  1578. |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1579. |> around the #pragma align=68k or PowerPC generation, though.
  1580.  
  1581.  
  1582. The last version of xlc I installed on our research RS/6000 supposedly
  1583. has PowerPC code generation support ( using -qarch=ppc ).
  1584. The man page claims that it will
  1585.  
  1586.     "Produce an object that contains instructions that will
  1587.     run on any of the 32-bit PowerPC hardware platforms."
  1588.  
  1589. Also, one can specify an alignment option for aligning structs and unions.
  1590. The choices are 'power' for the POWER architecture, 'twobyte' for two
  1591. byte alignment, and 'packed' for one byte alignment.
  1592. How would this relate to the 'align=68k' pragma discussed above?
  1593.  
  1594. Pascal strings would be an interesting addition, nevertheless.
  1595.  
  1596. Phil Roth
  1597. proth@cs.uiuc.edu
  1598.  
  1599.  
  1600. +++++++++++++++++++++++++++
  1601.  
  1602. >From zstern@adobe.com (Zalman Stern)
  1603. Date: Fri, 15 Apr 1994 10:15:09 GMT
  1604. Organization: Adobe Systems Incorporated
  1605.  
  1606. Ken Prehoda <kenp@nmrfam.wisc.edu> writes
  1607. > I have access to an RS/6000 with the xlc compiler.  My
  1608. > question is how do I use this compiler to generate
  1609. > code for the mac.  Could someone with experience in
  1610. > this area please give me some pointers?
  1611.  
  1612. Both Metrowerks and Apple's Macintosh on RISC SDK will accept XCOFF object  
  1613. files from the RS/6000. And if you have the very latest version of IBM's  
  1614. compilers, you should be able to compile with the Universal headers. (I  
  1615. believe Charlie Reiman's comment that the Mac specific features are not in  
  1616. the shipping version of IBM's compiler is incorrect.) You'll likely need to  
  1617. muck with the xlc configuration though. You can either do this by hand  
  1618. feeding in a bunch of flags on the command line, or by making a custom  
  1619. xlc.cfg file. (Which is only slightly more fun than smacking yourself in the  
  1620. head with an axe repeatedly.) The important compiler options you'll need  
  1621. are:
  1622.  
  1623. -qmacpstr -qpascal -qenum=small -qcpluscmt -qldbl128 -qchars=signed  
  1624. -D__powerc=1 -Dpowerc=1 -DUSE68KINLINES=0 -U_AIX
  1625.  
  1626. You'll need a -I directive pointing to the Universal headers somewhere on  
  1627. your AIX box. (Unless the code doesn't rely on Macintosh interfaces in which  
  1628. case its a lot easier. For example if you just have some computation  
  1629. intensive routines you want to compile.) You might also want to add a  
  1630. -qNOSTDINC to tell xlc not to search the standard system include  
  1631. directories.
  1632.  
  1633. You can link on the AIX box as well if you have the right libraries, which  
  1634. can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1635. result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1636. haul the .o files over to your Mac (being sure to use a binary transfer  
  1637. method that preserves every last bit in its pristine natural form) and use  
  1638. Apple's PowerPC linker within MPW. (I've never used Apple's SDK, so I really  
  1639. have no idea how that works.) Once you've gotten a fully linked XCOFF file,  
  1640. you can feed it to makepef to produce your PEF container. (And you'll have  
  1641. to do that in MPW 'cause I doubt Apple is distributing the RS/6000 version  
  1642. of makepef anywhere.)
  1643.  
  1644. I'll let John McEnerney detail how you use AIX generated objects with  
  1645. CodeWarrior. So far I've figured out that you need a file of type XCOF and  
  1646. creator UNIX which is a shared reuseable XCOFF library. I believe this  
  1647. implies that CodeWarrior will only link against shared libraries this way,  
  1648. that you can't link the code directly into your app. (Then again I really  
  1649. have no idea how it works.) If that's true, you'll need to make a shared  
  1650. library out of the code you compile on AIX. (The specific process of making  
  1651. a shared library is a a bit involved, but on AIX, you'll need to give ld at  
  1652. least the -bM:SRE switch and an exports file. You feed the output of that to  
  1653. makepef and shove a cfrg resource in the resource fork of the result.)
  1654.  
  1655. Suffice it to say, this is not a trivial task. Though realistically, it is  
  1656. probably the best development environment for Power Macintosh right now.  
  1657. Especially if you have a really huge app, or are working in C++.
  1658. --
  1659. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1660. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1661. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1662.  
  1663. +++++++++++++++++++++++++++
  1664.  
  1665. >From zstern@adobe.com (Zalman Stern)
  1666. Date: Sat, 16 Apr 1994 01:31:01 GMT
  1667. Organization: Adobe Systems Incorporated
  1668.  
  1669. Phil Roth writes
  1670. > In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike  
  1671. Gleason) writes:
  1672. > |> creiman@netcom.com (Charlie Reiman) writes:
  1673. > |> 
  1674. > |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1675. > |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1676. > |> |>do I use this compiler to generate code for the mac. Could someone  
  1677. with
  1678. > |> |>experience in this area please give me some pointers?
  1679. > |> 
  1680. > |> |You can't, really. The xlc that apple is giving to developers is
  1681. > |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1682. > |> |(very important), and pascal strings (also important). Also, their xlc
  1683. > |> |generates instructions for the PowerPC which probably isn't an option
  1684. > |> |on older versions of xlc.
  1685. > |> 
  1686. > |> Too bad... one could write a preprocessor that could handle the  
  1687. 'pascal'
  1688. > |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1689. > |> around the #pragma align=68k or PowerPC generation, though.
  1690. > The last version of xlc I installed on our research RS/6000 supposedly
  1691. > has PowerPC code generation support ( using -qarch=ppc ).
  1692. > The man page claims that it will
  1693. >     "Produce an object that contains instructions that will
  1694. >     run on any of the 32-bit PowerPC hardware platforms."
  1695. > Also, one can specify an alignment option for aligning structs and unions.
  1696. > The choices are 'power' for the POWER architecture, 'twobyte' for two
  1697. > byte alignment, and 'packed' for one byte alignment.
  1698. > How would this relate to the 'align=68k' pragma discussed above?
  1699.  
  1700. "#pragma options align=mac68k" is a synonym for "#pragma options  
  1701. align=twobyte". Try using the mac68k syntax with the shipping 1.03 version  
  1702. of xlc and I bet it will work. By the way, I left out the "-qarch=ppc"  
  1703. switch in my previous message in this thread. You should give that to xlc to  
  1704. prevent it from generating POWER architecture only instructions.
  1705. --
  1706. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1707. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1708. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1709.  
  1710. +++++++++++++++++++++++++++
  1711.  
  1712. >From d88-jwa@mumrik.nada.kth.se (Jon W‰tte)
  1713. Date: 16 Apr 1994 09:39:13 GMT
  1714. Organization: The Royal Institute of Technology
  1715.  
  1716. In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1717.  
  1718. >You can link on the AIX box as well if you have the right libraries, which  
  1719. >can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1720. >result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1721.  
  1722. Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1723. it from an engineer who should know) It's just that they're 3 times the
  1724. size of a PEF...
  1725.  
  1726. -- 
  1727.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1728.  "If people bought cars according to the same principles they buy computers,
  1729.   cars would behave like Lamborghinis but would be built and look like Yugos."
  1730.                      -- Craig Fields
  1731.  
  1732. +++++++++++++++++++++++++++
  1733.  
  1734. >From creiman@netcom.com (Charlie Reiman)
  1735. Date: Mon, 18 Apr 1994 02:53:13 GMT
  1736. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1737.  
  1738. d88-jwa@mumrik.nada.kth.se (Jon W‰tte) writes:
  1739.  
  1740. >In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1741.  
  1742. >>You can link on the AIX box as well if you have the right libraries, which  
  1743. >>can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1744. >>result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1745.  
  1746. >Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1747. >it from an engineer who should know) It's just that they're 3 times the
  1748. >size of a PEF...
  1749.  
  1750. 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1751. that is 70-80megs. 
  1752.  
  1753. Yes, linking takes forever.
  1754.  
  1755. -- 
  1756. "You can't cancel the project! We already made the T-shirts!"
  1757. Charlie Reiman
  1758. creiman@netcom.com
  1759.  
  1760. +++++++++++++++++++++++++++
  1761.  
  1762. >From zstern@adobe.com (Zalman Stern)
  1763. Date: Mon, 18 Apr 1994 04:16:26 GMT
  1764. Organization: Adobe Systems Incorporated
  1765.  
  1766. Charlie Reiman writes
  1767. [XCOFF vs. PEF.]
  1768. > 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1769. > that is 70-80megs. 
  1770. > Yes, linking takes forever.
  1771.  
  1772. You build with full debug symbols right? XCOFF is a pig, but not that much  
  1773. of a pig. PEF doesn't contain any debug info of course. the .xSYM file for  
  1774. your XCOFF is probably measured in tens of megabytes though.
  1775.  
  1776. Likewise, IBM linker is dramatically faster if you turn off debug info for  
  1777. the compiler. (Unfortunately, there is no switch to the linker to ignore  
  1778. debug info for all but a few object files.) On a pretty hefty RS/6000, I can  
  1779. link in 15 minutes with full symbols and 1 minute with no symbols. I leave  
  1780. in traceback tables (the moral equivalent of Macsbug names) and debug a lot  
  1781. of stuff that way. And at the end of the day, if I'm lucky I manage to club  
  1782. some small mammal on the way back to the cave so I can have dinner :-)
  1783. --
  1784. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1785. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1786. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1787.  
  1788. +++++++++++++++++++++++++++
  1789.  
  1790. >From maynard@elwing.otago.ac.nz (Maynard James Handley)
  1791. Date: Wed, 20 Apr 1994 22:59:21 GMT
  1792. Organization: University of Otago
  1793.  
  1794. Apart from issues like 68K alignment and pascal strings, are there not 
  1795. fundamental problems at the "OS" level?
  1796. For examples, doesn't AIX have conventions about using the first N registers
  1797. to pass variables between functions. I don't know if MacOS on PowerPC has
  1798. such conventions, but it expectects one of the registers always to point
  1799. to the code fragment TOC thingie---would it not be very bad if xlc used
  1800. said register for something else.
  1801.  
  1802. Are these valid issues or not? I don't yet have a copy of IM: RISC system 
  1803. software, so please be gentle if I'm spouting nonsense.
  1804.  
  1805. Maynard Handley
  1806.  
  1807. +++++++++++++++++++++++++++
  1808.  
  1809. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  1810. Date: Thu, 21 Apr 1994 11:22:55 +0800
  1811. Organization: Department of Computer Science, The University of Western Australia
  1812.  
  1813. In article <CoKyIx.I7F@news.otago.ac.nz>, maynard@elwing.otago.ac.nz
  1814. (Maynard James Handley) wrote:
  1815.  
  1816. >Apart from issues like 68K alignment and pascal strings, are there not 
  1817. >fundamental problems at the "OS" level?
  1818. >
  1819. >[lots of talk about calling conventions]
  1820.  
  1821. My understanding is that Apple block-copied IBM's runtime architecture for
  1822. their PowerMacs.  [This is not a criticism, just an observation.  The
  1823. run-time architecture is kinda cool -- apart from the *extreme* silliness
  1824. of allocating two GPRs for each FP parameter just to support
  1825. prototype-less C calling!]
  1826. -- 
  1827. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  1828. Department of Computer Science, The University of Western Australia
  1829.  
  1830. +++++++++++++++++++++++++++
  1831.  
  1832. >From zstern@adobe.com (Zalman Stern)
  1833. Date: Thu, 21 Apr 1994 05:53:08 GMT
  1834. Organization: Adobe Systems Incorporated
  1835.  
  1836. Maynard James Handley writes
  1837. > Apart from issues like 68K alignment and pascal strings, are there not 
  1838. > fundamental problems at the "OS" level?
  1839. > For examples, doesn't AIX have conventions about using the first N  
  1840. registers
  1841. > to pass variables between functions. I don't know if MacOS on PowerPC has
  1842. > such conventions, but it expectects one of the registers always to point
  1843. > to the code fragment TOC thingie---would it not be very bad if xlc used
  1844. > said register for something else.
  1845.  
  1846. The runtime architecture you are refering to was developed by IBM and  
  1847. adopted basically without change by Apple. Binaries running on the RS/6000  
  1848. have used r2 as a TOC pointer for more than four years now. (And that  
  1849. particular convention pretty much came from the IBM RT which shipped in  
  1850. '86.) The PowerPC code in the Power Macintosh ROMs is compiled with xlc.
  1851. --
  1852. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1853. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1854. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1855.  
  1856. +++++++++++++++++++++++++++
  1857.  
  1858. >From R.Beloin@cornell.edu (Ron Beloin)
  1859. Date: Thu, 21 Apr 1994 11:57:00 -0500
  1860. Organization: Boyce Thompson Inst. for Plant Research
  1861.  
  1862. In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1863. Stern) wrote:
  1864. > [XCOFF vs. PEF.]
  1865. > [other stuff about XCOFF]
  1866.  
  1867. Sorry for the basic question, but how does one link XCOFF format
  1868. files from an RS6K in MPW? E.G., what version of Link do i need, what
  1869. options or swithches are required. I already have the RS6K and E.T.O.
  1870. Thanks.
  1871. -- 
  1872. Ron Beloin (R.Beloin@cornell.edu)
  1873. [who works, but doesn't speak, for the]
  1874. Boyce Thompson Inst.
  1875. Ithaca, NY
  1876.  
  1877. +++++++++++++++++++++++++++
  1878.  
  1879. >From zstern@adobe.com (Zalman Stern)
  1880. Date: Thu, 21 Apr 1994 23:31:46 GMT
  1881. Organization: Adobe Systems Incorporated
  1882.  
  1883. Ron Beloin writes
  1884. > In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1885. > Stern) wrote:
  1886. > > [XCOFF vs. PEF.]
  1887. > > [other stuff about XCOFF]
  1888. > Sorry for the basic question, but how does one link XCOFF format
  1889. > files from an RS6K in MPW? E.G., what version of Link do i need, what
  1890. > options or swithches are required. I already have the RS6K and E.T.O.
  1891. > Thanks.
  1892.  
  1893. You need ppclink off the Macintosh on RISC SDK.
  1894. --
  1895. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1896. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1897. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1898.  
  1899. +++++++++++++++++++++++++++
  1900.  
  1901. >From d88-jwa@mumrik.nada.kth.se (Jon W‰tte)
  1902. Date: 23 Apr 1994 10:40:51 GMT
  1903. Organization: The Royal Institute of Technology
  1904.  
  1905. In <R.Beloin-210494115700@theq.cit.cornell.edu> R.Beloin@cornell.edu (Ron Beloin) writes:
  1906.  
  1907. >Sorry for the basic question, but how does one link XCOFF format
  1908. >files from an RS6K in MPW? E.G., what version of Link do i need, what
  1909. >options or swithches are required. I already have the RS6K and E.T.O.
  1910.  
  1911. You need the Mac on RISC SDK CD which comes with PPCLink and
  1912. MakePEF. It also comes with the right headers and libraries.
  1913.  
  1914. Cheers,
  1915. -- 
  1916.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1917.  
  1918.   "Never mistake a clear view for a short distance"
  1919.                      -- Saffo
  1920.  
  1921. +++++++++++++++++++++++++++
  1922.  
  1923. >From Dave Falkenburg <falken@apple.com>
  1924. Date: Thu, 28 Apr 1994 17:03:33 GMT
  1925. Organization: Apple Computer, Inc.
  1926.  
  1927. In article <CoKyIx.I7F@news.otago.ac.nz> Maynard James Handley,
  1928. maynard@elwing.otago.ac.nz writes:
  1929. >For examples, doesn't AIX have conventions about using the first N
  1930. registers
  1931. >to pass variables between functions. I don't know if MacOS on PowerPC has
  1932. >such conventions, but it expectects one of the registers always to point
  1933. >to the code fragment TOC thingie---would it not be very bad if xlc used
  1934. >said register for something else.
  1935.  
  1936. The PowerMac runtime environment is dervied from the AIX runtime model--
  1937. we used special versions of xlc to build the native portions of the
  1938. toolbox.
  1939.  
  1940. -Dave Falkenburg
  1941. -Apple Computer, Inc.
  1942.  
  1943. ---------------------------
  1944.  
  1945. End of C.S.M.P. Digest
  1946. **********************
  1947.  
  1948.  
  1949.  
  1950.